import { defineStore } from 'pinia'
import { SpinState } from '@/store/types/spin-loading'
import { Slot } from 'vue'
const useSpinStore = defineStore({
    id: 'spin',
    state: (): SpinState => ({
        spinning: false,
        tip: '加载中。。。',
        delay: 900
    }),
    getters: {
       
    },
    actions: {
        setSpinState(spinState: SpinState) {
            this.$state = spinState
        },
        setSpinStateSpinning(spinning: boolean) {
            this.spinning = spinning
        },
        setSpinSimpleOption(spinning: boolean, tip?: string | Slot) {
            this.spinning = spinning
            this.tip = tip ? tip : this.tip
        },
    }
})

export default useSpinStore;